<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-if 和 V-show</title>
    <script src="vue.js"></script>
  </head>
  <body>
    <div id="app">
      年龄： <input type="text" name="" id="" v-model="age" />经判定，为：

      <span v-if="age <= 35">年轻人(35及以下)</span>
      <span v-if="age > 35 && age < 60">中年人(35-60)</span>
      <span v-if="age >= 60 ">老年人(60及以上)</span>
      <br /><br />

      年龄： <input type="text" name="" id="" v-model="age1" />经判定，为：

      <span v-show="age1 <= 35">年轻人(35及以下)</span>
      <span v-show="age1 > 35 && age < 60">中年人(35-60)</span>
      <span v-show="age1 >= 60 ">老年人(60及以上)</span>
      <br /><br />
    </div>
  </body>
  <script>
    new new Vue({
      el: "#app",
      data() {
        return {
          age: 20,
          age1: 20,
        };
        methods: {
        }
      },
    })();
  </script>
</html>
